<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.andy.manage.mapper.TabUserMapper">
    <resultMap id="BaseResultMap" type="com.andy.manage.model.TabUser">
        <!--@mbg.generated-->
        <!--@Table tab_user-->
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="user_name" jdbcType="VARCHAR" property="userName"/>
        <result column="pass_word" jdbcType="VARCHAR" property="passWord"/>
        <result column="nick_name" jdbcType="VARCHAR" property="nickName"/>
        <result column="user_type" jdbcType="VARCHAR" property="userType"/>
        <result column="user_email" jdbcType="VARCHAR" property="userEmail"/>
        <result column="phone_number" jdbcType="VARCHAR" property="phoneNumber"/>
        <result column="user_sex" jdbcType="CHAR" property="userSex"/>
        <result column="user_address" jdbcType="VARCHAR" property="userAddress"/>
        <result column="user_avatar" jdbcType="VARCHAR" property="userAvatar"/>
        <result column="user_status" jdbcType="INTEGER" property="userStatus"/>
        <result column="is_deleted" jdbcType="CHAR" property="isDeleted"/>
        <result column="created_by_id" jdbcType="VARCHAR" property="createdById"/>
        <result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/>
        <result column="last_modify_time" jdbcType="TIMESTAMP" property="lastModifyTime"/>
        <result column="remark" jdbcType="VARCHAR" property="remark"/>
    </resultMap>
    <sql id="Base_Column_List">
        <!--@mbg.generated-->
        id, user_name, pass_word, nick_name, user_avator, user_type, user_email, phone_number,
        user_sex, user_avatar, user_status, user_address, is_deleted, created_by_id, created_time,
        last_modify_time, remark
    </sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        <!--@mbg.generated-->
        select
        <include refid="Base_Column_List"/>
        from tab_user
        where id = #{id,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        <!--@mbg.generated-->
        delete
        from tab_user
        where id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.andy.manage.model.TabUser"
            useGeneratedKeys="true">
        <!--@mbg.generated-->
        insert into tab_user (user_name, pass_word, nick_name,
        user_type, user_email,
        phone_number, user_sex, user_address, user_avatar,
        user_status, is_deleted, created_by_id,
        created_time, last_modify_time,
        remark)
        values (#{userName,jdbcType=VARCHAR}, #{passWord,jdbcType=VARCHAR}, #{nickName,jdbcType=VARCHAR},
        #{userType,jdbcType=VARCHAR}, #{userEmail,jdbcType=VARCHAR},
        #{phoneNumber,jdbcType=VARCHAR}, #{userSex,jdbcType=CHAR}, #{userAddress,jdbcType=VARCHAR},
        #{userAvatar,jdbcType=VARCHAR},
        #{userStatus,jdbcType=INTEGER}, #{isDeleted,jdbcType=CHAR}, #{createdById,jdbcType=VARCHAR},
        #{createdTime,jdbcType=TIMESTAMP},
        #{lastModifyTime,jdbcType=TIMESTAMP},
        #{remark,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.andy.manage.model.TabUser"
            useGeneratedKeys="true">
        <!--@mbg.generated-->
        insert into tab_user
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="userName != null">
                user_name,
            </if>
            <if test="passWord != null">
                pass_word,
            </if>
            <if test="nickName != null">
                nick_name,
            </if>
            <if test="userType != null">
                user_type,
            </if>
            <if test="userEmail != null">
                user_email,
            </if>
            <if test="phoneNumber != null">
                phone_number,
            </if>
            <if test="userSex != null">
                user_sex,
            </if>
            <if test="userAddress != null">
                user_address,
            </if>
            <if test="userAvatar != null">
                user_avatar,
            </if>
            <if test="userStatus != null">
                user_status,
            </if>
            <if test="isDeleted != null">
                is_deleted,
            </if>
            <if test="createdById != null">
                created_by_id,
            </if>
            <if test="createdTime != null">
                created_time,
            </if>
            <if test="lastModifyTime != null">
                last_modify_time,
            </if>
            <if test="remark != null">
                remark,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="userName != null">
                #{userName,jdbcType=VARCHAR},
            </if>
            <if test="passWord != null">
                #{passWord,jdbcType=VARCHAR},
            </if>
            <if test="nickName != null">
                #{nickName,jdbcType=VARCHAR},
            </if>
            <if test="userType != null">
                #{userType,jdbcType=VARCHAR},
            </if>
            <if test="userEmail != null">
                #{userEmail,jdbcType=VARCHAR},
            </if>
            <if test="phoneNumber != null">
                #{phoneNumber,jdbcType=VARCHAR},
            </if>
            <if test="userSex != null">
                #{userSex,jdbcType=CHAR},
            </if>
            <if test="userAddress != null">
                #{userAddress,jdbcType=VARCHAR},
            </if>
            <if test="userAvatar != null">
                #{userAvatar,jdbcType=VARCHAR},
            </if>
            <if test="userStatus != null">
                #{userStatus,jdbcType=INTEGER},
            </if>
            <if test="isDeleted != null">
                #{isDeleted,jdbcType=CHAR},
            </if>
            <if test="createdById != null">
                #{createdById,jdbcType=VARCHAR},
            </if>
            <if test="createdTime != null">
                #{createdTime,jdbcType=TIMESTAMP},
            </if>
            <if test="lastModifyTime != null">
                #{lastModifyTime,jdbcType=TIMESTAMP},
            </if>
            <if test="remark != null">
                #{remark,jdbcType=VARCHAR},
            </if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.andy.manage.model.TabUser">
        <!--@mbg.generated-->
        update tab_user
        <set>
            <if test="userName != null">
                user_name = #{userName,jdbcType=VARCHAR},
            </if>
            <if test="passWord != null">
                pass_word = #{passWord,jdbcType=VARCHAR},
            </if>
            <if test="nickName != null">
                nick_name = #{nickName,jdbcType=VARCHAR},
            </if>
            <if test="userType != null">
                user_type = #{userType,jdbcType=VARCHAR},
            </if>
            <if test="userEmail != null">
                user_email = #{userEmail,jdbcType=VARCHAR},
            </if>
            <if test="phoneNumber != null">
                phone_number = #{phoneNumber,jdbcType=VARCHAR},
            </if>
            <if test="userSex != null">
                user_sex = #{userSex,jdbcType=CHAR},
            </if>
            <if test="userAvatar != null">
                user_avatar = #{userAvatar,jdbcType=VARCHAR},
            </if>
            <if test="userStatus != null">
                user_status = #{userStatus,jdbcType=INTEGER},
            </if>
            <if test="isDeleted != null">
                is_deleted = #{isDeleted,jdbcType=CHAR},
            </if>
            <if test="createdById != null">
                created_by_id = #{createdById,jdbcType=VARCHAR},
            </if>
            <if test="createdTime != null">
                created_time = #{createdTime,jdbcType=TIMESTAMP},
            </if>
            <if test="lastModifyTime != null">
                last_modify_time = #{lastModifyTime,jdbcType=TIMESTAMP},
            </if>
            <if test="remark != null">
                remark = #{remark,jdbcType=VARCHAR},
            </if>
        </set>
        where id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKey" parameterType="com.andy.manage.model.TabUser">
        <!--@mbg.generated-->
        update tab_user
        set user_name = #{userName,jdbcType=VARCHAR},
        pass_word = #{passWord,jdbcType=VARCHAR},
        nick_name = #{nickName,jdbcType=VARCHAR},
        user_type = #{userType,jdbcType=VARCHAR},
        user_email = #{userEmail,jdbcType=VARCHAR},
        phone_number = #{phoneNumber,jdbcType=VARCHAR},
        user_sex = #{userSex,jdbcType=CHAR},
        user_address = #{userAddress,jdbcType=VARCHAR},
        user_avatar = #{userAvatar,jdbcType=VARCHAR},
        user_status = #{userStatus,jdbcType=INTEGER},
        is_deleted = #{isDeleted,jdbcType=CHAR},
        created_by_id = #{createdById,jdbcType=VARCHAR},
        created_time = #{createdTime,jdbcType=TIMESTAMP},
        last_modify_time = #{lastModifyTime,jdbcType=TIMESTAMP},
        remark = #{remark,jdbcType=VARCHAR}
        where id = #{id,jdbcType=BIGINT}
    </update>
</mapper>